package com.imagecollector.common.task;

import com.imagecollector.service.ITaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.logging.Logger;

/**
 * @Author: wrf
 * @Date: 2024/8/3 13:45
 * @Description: 定时任务
 */
@Slf4j
@Component
public class ScheduledTasks {

    @Autowired
    private ITaskService taskService;

    @Async
    @Scheduled(cron = "0/10 * * * * ?")
    public void scanTaskAndSetExpireStatus(){
        taskService.scanTaskAndSetExpireStatus();
    }

}
